#ifndef _TEXTURE_MANAGER_H
#define _TEXTURE_MANAGER_H

enum texType
{
	UNKNOWN,
	BMP,
	JPG,
	PNG,
	TGA,
	GIF,
	ICO,
	EMF,
	WMF
};

struct glTexture
{
	unsigned int textureID;  // opengl texture id
	texType type;
	int width;
	int height;
	int glType;     // opengl texture type (GL_RGB,GL_RGBA, etc..)
	int bpp;        // bits per pixel
};

struct tgaHeader
{
	unsigned char imgIdent;
	unsigned char ignored[1];
	unsigned char imgType;
	unsigned char ignored2[9];
	unsigned char widthLo;
	unsigned char widthHi;
	unsigned char heightLo;
	unsigned char heightHi;
	unsigned char bpp;
	unsigned char ignored3[1];
};

class TextureManager
{
public:
	TextureManager();
	~TextureManager();
	bool loadTextureFromDisk(const char* file, glTexture* texture);
	void freeTexture(glTexture* texture);
private:
	bool loadBMPFromDisk(const char *file, glTexture* texture);
	void generateTexture(glTexture* texture, char *data);
	bool loadTGAFromDisk(const char* file,glTexture* texture);
};

#endif